#ifndef _SIMPLE_GL_H
#define _SIMPLE_GL_H


#include "pngLoad.h"
#include <ft2build.h>
#include FT_FREETYPE_H

typedef struct {
	int r;
	int g;
	int b;
} GL_color_RGB;


typedef struct {
	int r;
	int g;
	int b;
	int a;
} GL_color_RGBA;

typedef struct {
	float r;
	float g;
	float b;
	float a;
} GL_color;

typedef struct {
	int width;
	int height;
	int tex_index;
} GL_image;

typedef struct {
	FT_Face face;
} GL_font2;

typedef struct {
	GL_font2 *font;
	GL_color color;
	int width;
	int height;
	int size;
	int textureSize;
	char *text;
	int tex_index;
} GL_label;



void initGL(int xRes, int yRes);
void resizeGL(int xRes, int yRes);
int GL_Init(int xRes, int yRes, char isFullscreen, char *caption);
void GL_Shutdown();
void GL_BeginRender();
void GL_EndRender();

void GL_GradientRect(float x, float y, float w, float h, GL_color_RGBA c1, GL_color_RGBA c2);
void GL_VerticalGradientRect(float x, float y, float w, float h, GL_color_RGBA c1, GL_color_RGBA c2);
void GL_Rect(float x, float y, float w, float h, GL_color_RGBA c1, float rotation);
void GL_DrawImage(GL_image *image, float x, float y, float w, float h, float rotation);
void GL_DrawZImage(GL_image *image, float x, float y, float w, float h, float rotation, float z);
void GL_DrawTintedImage(GL_image *image, float x, float y, float w, float h, float rotation, GL_color_RGBA c1);
int GL_LoadImage(char *filename, GL_image *targetImage);

void GL_CreateFont2(char *filename, GL_font2 *font);
void GL_SetLabelText(GL_label *label, char *text);
void GL_CreateLabel(GL_label *label, GL_font2 *font, char *text, int texRes, int texSize, GL_color_RGBA c1);
void GL_DrawLabel(GL_label *label, float size, float x, float y);
int GL_GetModeWidth(int modenum);
int GL_GetModeHeight(int modenum);
int GL_GetNumVideoModes();
void GL_SetVideoMode(int video_mode_index, int fullscreen);

long Timer_GetTicks();

#endif
